﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SarsClient
{
    class RoomList
    {
        List<Peer> roomMembers;

        public RoomList()
        {
            roomMembers = new List<Peer>();
        }

        public void addMember(Peer peer)
        {
            if (!roomMembers.Contains(peer))
            {
                roomMembers.Add(peer);
            }
        }

        public void removeMember(Peer peer)
        {
            roomMembers.Remove(peer);
        }

        public List<Peer> getRoomMembers()
        {
            return roomMembers;
        }

        public override string ToString()
        {
            string result = "";

            foreach(Peer member in roomMembers)
            {
                result = result + member.Id + "\n";
            }

            return result;
        }
    }
}

